package informed.interact;

import informed.samples.Sample;
import informed.samples.VectorValueSample;
import informed.sgd.LatentTransformation;

import java.util.ArrayList;

public class Main {
	
	public static void main(String[] args){
		String y = "/home/jccaicedo/workspace/StochasticGradientDescent/data/corel/text.txt";
		String x = "/home/jccaicedo/workspace/StochasticGradientDescent/data/corel/visual.txt";
		long start = System.currentTimeMillis();
		ArrayList<Sample> samples = VectorValueSample.loadSparseSamples(x, y);
		System.out.println("Matrix file read. Samples = "+samples.size());
		long end = System.currentTimeMillis();
		System.out.println("Time loading data: " + (end-start));
		
		int textTerms = 374;
		int visualTerms = 2000;
		int latentFactors = 30;
		start = System.currentTimeMillis();
		LatentTransformation problem = new LatentTransformation(textTerms, visualTerms, latentFactors);
		problem.run(samples, 1);
		end = System.currentTimeMillis();
		System.out.println("Time processing: " + (end-start));
	}

}
